package com.esdk.sql;

import com.esdk.esdk;

import java.util.Objects;

public class OnCondition extends Condition{
  Field leftField,rightField;
  
  public OnCondition(Field leftfield,Field rightfield) {
    leftField=leftfield;
    rightField=rightfield;
  }

  @Override
  public boolean equals(Object o){
    if(this==o) return true;
    if(o==null||getClass()!=o.getClass()) return false;
    if(!super.equals(o)) return false;
    OnCondition that=(OnCondition)o;
    return this.toString().equals(that.toString());
  }

  @Override
  public int hashCode(){
    return Objects.hash(super.hashCode(),leftField,rightField);
  }

  public String toString() {
    return leftField.toString().concat("=").concat(rightField.toString());
  }
  
}
